package com.easyCode.sqlMapper.mapInfo;

import lombok.Builder;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.time.LocalDateTime;

/**
 * @author 大忽悠
 * @create 2022/12/2 14:22
 */
@Data
@Builder
public class FiledMapInfo implements MapInfo {
    /**
     * 字段名
     */
    private String filedName;
    /**
     * 字段类型
     */
    private String mapType;
    /**
     * 字段注释
     */
    private String comment;
    /**
     * 当前字段的顺序: 不设置默认为最小优先级
     */
    private Integer order = Integer.MIN_VALUE;

    public boolean commentEmpty(){
        return StringUtils.isEmpty(comment);
    }

    public boolean localDateTime(){
        return mapType.equalsIgnoreCase(LocalDateTime.class.getSimpleName());
    }
}
